/**
 * 
 */
package net.cloudcodex.client.character.view;

import net.cloudcodex.client.character.view.CharactersView.Message;
import net.cloudcodex.client.character.view.panel.NotesPanel;
import net.cloudcodex.shared.dto.campaign.character.CharacterNoteDTO;

import com.google.gwt.event.dom.client.HasKeyDownHandlers;
import com.google.gwt.event.dom.client.HasKeyUpHandlers;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.inject.Inject;

/**
 * @author dweltz
 * 
 */
public class CharactersNoteViewImpl extends FlowPanel implements
		CharactersNoteView {
	private Message message;
	private NotesPanel notesPanel = new NotesPanel();
	@Inject
	public CharactersNoteViewImpl(Message message) {
		this.message = message;
	}
	
	@Override
	public void initComponents(){

		notesPanel.initComponents();

		this.add(notesPanel);
	}
	
	@Override
	public void addCharacterNote(String content) {
		notesPanel.addCharacterNote(content);
	}
	
	@Override
	public void addCharacterNoteID(Long characterID){
		notesPanel.addCharacterNoteID(characterID);
	}

	@Override
	public void addCharacterAvatar(Long id, String icon, String name) {
		notesPanel.addCharacterAvatar(id, icon, name);
	}
	
	@Override
	public HasKeyUpHandlers getTextAreaKeyUpHandler (){
		return notesPanel ;
	}
	
	@Override
	public HasKeyDownHandlers getTextAreaKeyDownHandler (){
		return notesPanel ;
	}

	@Override
	public CharacterNoteDTO getChangedNotes() {
		return notesPanel.getChangedNotes();
	}

	@Override
	public void refreshNote(String content) {
		this.notesPanel.refreshNote(content);
	}

	@Override
	public Long getNoteAuthor() {
		return notesPanel.getNoteAuthor();
	}

	@Override
	public void addAuthor(Long authorID) {
		notesPanel.addAuthor(authorID);
	}
	

}
